|
|
Hi,
I'm not sure I understand how it's treated so please enlighten me. Looking
at the code, it seems to me that there's a "problem" in the determination of
refracted rays.
Say you have a glass filled with water as per lousy diagram below
+-------+ air
| |+----------------+
| || |
air | glass || water |
| || |
| |+----------------+
| +------------------
|
+--------------------------
Say a ray is shot from the right side.
a) ray starts in the air and hits the side of the glass. Ray_Enter() will
add "glass" to the list of traversed media. A refracted "air/glass" ray is
spawned
b) the refracted ray from (a) will hit the "other" of the glass, in other
words it exits the glass. Glass is removed from the "stack" by Ray_Exit().
A new refracted ray is spawned.
Where I'm not sure I got it straight is that it looks like the refracted ray
in b) is going to be "glass/air" instead of "glass/water" as we don't know
yet that water will be hit.
Comments are most welcome.
Best regards,
MC
Post a reply to this message
|
|